<template>
  <div class="tab">
    <router-link
      class="tab-item"
      v-for="item in tabs"
      :key="item.path"
      :to="item.path"
      tag="div"
    >
      <span class="tab-link">{{ item.name }}</span>
    </router-link>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component({})
export default class extends Vue {
  private tabs: object[] = [
    {
      path: '/recommend',
      name: '推荐'
    },
    {
      path: '/singer',
      name: '歌手'
    },
    {
      path: '/rank',
      name: '排行'
    },
    {
      path: '/search',
      name: '搜索'
    }
  ]
}
</script>

<style scoped lang="stylus">
  @import "~@/common/style/variable"
  .tab
    display flex
    height 44px
    line-height 44px
    font-size $font-size-medium
    .tab-item
      flex 1
      text-align center
      .tab-link
        padding-bottom 5px
        color $color-text-l
      &.router-link-active
        .tab-link
          color $color-theme
          border-bottom 2px solid $color-theme
</style>
